<?php echo $header; ?><?php echo $column_left; ?>
<div id="content">
  <div class="page-header">
    <div class="container-fluid">
      <div class="pull-right">
        <button type="submit" form="form-category" data-toggle="tooltip" title="<?php echo $button_save; ?>" class="btn btn-primary"><i class="fa fa-save"></i></button>
        <a href="<?php echo $cancel; ?>" data-toggle="tooltip" title="<?php echo $button_cancel; ?>" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
      <h1><?php echo $heading_title; ?></h1>
      <ul class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
        <?php } ?>
      </ul>
    </div>
  </div>
  <div class="container-fluid">
    <?php if ($error_warning) { ?>
    <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning; ?>
      <button type="button" class="close" data-dismiss="alert">&times;</button>
    </div>
    <?php } ?>
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title"><i class="fa fa-pencil"></i> <?php echo $text_form; ?></h3>
      </div>
      <div class="panel-body">
        <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form-category" class="form-horizontal">
          <!-- <input type="hidden" name="project_customer_id" value="<?php echo $project_customer_id; ?>" >  -->
          <ul class="nav nav-tabs">
            <li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $tab_general; ?></a></li>
          </ul>
          <div class="tab-content">
            <div class="tab-pane active" id="tab-general">
              <ul class="nav nav-tabs" id="language">
                <?php foreach ($languages as $language) { ?>
                <li><a href="#language<?php echo $language['language_id']; ?>" data-toggle="tab"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a></li>
                <?php } ?>
              </ul>
              <div class="tab-content">
                <?php foreach ($languages as $language) { ?>
                <div class="tab-pane" id="language<?php echo $language['language_id']; ?>">
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
                    <div class="col-sm-8">
                      <select name="status" id="input-status" class="form-control">
                        <option value="0" <?php if($status == 0 ){echo 'selected';} ?> >---請選擇---</option>
                        <?php foreach($status_all as $statu){ ?>
                            <option value="<?php echo $statu['id']; ?>" <?php if($statu['id'] == $status){echo 'selected';} ?> ><?php echo $statu['name_cn']; ?></option>
                        <?php } ?>
                      </select>
                    </div>
                  </div>
<!--                   <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-status"><?php echo $entry_status; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="status" value="<?php echo $status; ?>" placeholder="<?php echo $entry_status; ?>" id="input-status" class="form-control" />
                      <select></select>
                    </div>
                  </div> -->

                  <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-en_name_1"><?php echo $entry_en_name_1; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="en_name_1" value="<?php echo $en_name_1; ?>" placeholder="<?php echo $entry_en_name_1; ?>" id="input-en_name_1" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group required">
                    <label class="col-sm-2 control-label" for="input-cn_name_1"><?php echo $entry_cn_name_1; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="cn_name_1" value="<?php echo $cn_name_1; ?>" placeholder="<?php echo $entry_cn_name_1; ?>" id="input-cn_name_1" class="form-control" />
                    </div>
                  </div>

                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-en_name_2"><?php echo $entry_en_name_2; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="en_name_2" value="<?php echo $en_name_2; ?>" placeholder="<?php echo $entry_en_name_2; ?>" id="input-en_name_2" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-en_name_2"><?php echo $entry_cn_name_2; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="cn_name_2" value="<?php echo $en_name_2; ?>" placeholder="<?php echo $entry_en_name_2; ?>" id="input-en_name_2" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-en_name_3"><?php echo $entry_en_name_3; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="en_name_3" value="<?php echo $en_name_3; ?>" placeholder="<?php echo $entry_en_name_3; ?>" id="input-en_name_3" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-cn_name_3"><?php echo $entry_cn_name_3; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="cn_name_3" value="<?php echo $cn_name_3; ?>" placeholder="<?php echo $entry_cn_name_3; ?>" id="input-cn_name_3" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-name"><?php echo $entry_name; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="name" value="<?php echo $name; ?>" placeholder="<?php echo $entry_name; ?>" id="input-name" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-email"><?php echo $entry_email; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="email" value="<?php echo $email; ?>" placeholder="<?php echo $entry_email; ?>" id="input-email" class="form-control" />
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-tel"><?php echo $entry_tel; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="tel" value="<?php echo $tel; ?>" placeholder="<?php echo $entry_tel; ?>" id="input-tel" class="form-control" />
                    </div>
                  </div>

                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-registered_capital"><?php echo $entry_registered_capital; ?></label>
                    <div class="col-sm-8">
                      <input type="text" name="registered_capital" value="<?php echo $registered_capital; ?>" placeholder="<?php echo $entry_registered_capital; ?>" id="input-registered_capital" class="form-control" />
                    </div>
                  </div>

                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-sec_use"><?php echo $entry_sec_use; ?></label>
                    <div class="col-sm-8">
                      <label class="radio-inline">
                        <input type="radio" name="sec_use" value="Yes" <?php if($sec_use == 'Yes'){ echo 'checked'; } ?>  id="input-sec_use"  /><?php echo $entry_sec_use; ?>
                      </label>
                      <label class="radio-inline">
                        <input type="radio" name="sec_use" value="No" <?php if($sec_use == 'No'){ echo 'checked'; } ?> id="input-sec_use"  />Other
                      </label>

                      <label class="radio-inline">
                        <input type="text" name="sec_use_other" value="<?php if($sec_use == 'No'){ echo $sec_use_other; } ?>" placeholder="<?php echo $entry_sec_use; ?>" id="input-sec_use" class="form-control" />
                      </label>
                    </div>
                  </div>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-sec_addr"><?php echo $entry_sec_addr; ?></label>
                    <div class="col-sm-8" >
                      
                      <label class="radio-inline">
                        <input type="radio" name="sec_addr" value="Yes" id="input-sec_addr" <?php if($sec_addr == 'Yes'){ echo 'checked';} ?> ><?php echo $entry_sec_addr; ?>
                      </label>
                     <label class="radio-inline">
                       <select class="form-control">
                         <option></option>
                         <?php foreach($company_address as $value){ ?>
                          <option value="<?php echo $value['company_address_id']; ?>" <?php if($value['company_address_id'] == $sec_addr_other ){ echo 'selected';} ?> ><?php echo $value['address_name']; ?></option>
                         <?php } ?>
                       </select>
                     </label>
                      <label class="radio-inline">
                        <input type="radio" name="sec_addr" value="No" <?php if($sec_addr == 'No'){ echo 'checked';} ?> />Other
                      </label>

                      <label class="radio-inline">
                        <input type="text" name="sec_addr_other" value="<?php if($sec_addr == 'No'){ echo $sec_addr_other;} ?>" class="form-control" id="input-sec_addr_other"/>
                      </label>

                    </div>
                  </div>
                  <div class="form-group">
                  </div>
<!--                   <script type="text/javascript">
                      $('#input-sec_addr_other').on('change',function(){
                        var a = $(this).val();
                        $('input[data-id=\'input-sec_addr_other\']').val(a);
                      });
                  </script> -->
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-contact_person_name" ><?php echo $entry_gd; ?></label>
                    <div class="col-sm-8">
                    <table class="table table-bordered">
                      <?php if($gd){ ?>
                        <?php foreach($gd as $value){ ?>
                      <tr class="gd_id_card_<?php echo $value['img_sort']; ?>">
                        <td>香港身份證： 
                        <div class="input-group">
                                <input type="text" name="gd[<?php echo $value['img_sort']; ?>][id_card]" value="<?php echo $value['img_path']; ?>" id="gd_id_card_<?php echo $value['img_sort']; ?>" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload_ic btn btn-primary" data-id="<?php echo $value['img_sort']; ?>" id="gd_id_card_upload_<?php echo $value['img_sort']; ?>" style="<?php if($value['img_path']){ echo 'display: none'; } ?>" ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="<?php echo $domian.$value['img_path']; ?>" class="btn btn-primary gd_id_card_href_<?php echo $value['img_sort']; ?>" style="<?php if($value['img_path']){  }else{ echo 'display: none'; } ?>" ><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr class="gd_address_proof_<?php echo $value['img_sort']; ?>">
                        <td>住址地址：
                        <div class="input-group">
                                <input type="text" name="gd[<?php echo $value['img_sort']; ?>][address_proof]" value="<?php echo $value['img_addr_path']; ?>" id="gd_address_proof_<?php echo $value['img_sort']; ?>" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload_ap btn btn-primary" data-id="<?php echo $value['img_sort']; ?>" id="gd_address_proof_upload_<?php echo $value['img_sort']; ?>" style="<?php if($value['img_addr_path']){ echo 'display: none'; } ?>" ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="<?php echo $domian.$value['img_path']; ?>" class="btn btn-primary gd_address_proof_href_<?php echo $value['img_sort']; ?>" style="<?php if($value['img_addr_path']){  }else{ echo 'display: none'; } ?>" ><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr class="gd_address_proof_<?php echo $value['img_sort']; ?>">
                        <td>股份：
                        <div class="input-group">
                                <input type="text" name="gd[<?php echo $value['img_sort']; ?>][share]" value="<?php echo $value['share']; ?>" id="gd_share_<?php echo $value['img_sort']; ?>" class="form-control">
                        </div>  
                        </td>

                      </tr>
                      <?php } ?>
                      <tr>
                        <td style="text-align: center;" ><button type="button" class="gd_button btn btn-primary" data-id="<?php $en = end($gd); echo $en['img_sort']+1; ?>">+</button></td>
                      </tr>
                      <?php }else{?>
                      <tr class="gd_id_card_1">
                        <td>香港身份證： 
                        <div class="input-group">
                                <input type="text" name="gd[1][id_card]" value="" id="gd_id_card_1" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload_ic btn btn-primary" data-id='1' id='gd_id_card_upload_1' ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="" class="btn btn-primary gd_id_card_href_1" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr class="gd_address_proof_1">
                        <td>住址地址：
                        <div class="input-group">
                                <input type="text" name="gd[1][address_proof]" value="" id="gd_address_proof_1" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload_ap btn btn-primary" data-id='1' id='gd_address_proof_upload_1' ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="" class="btn btn-primary gd_address_proof_href_1" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr class="gd_address_proof_1">
                        <td>住址地址：
                        <div class="input-group">
                                <input type="text" name="gd[1][share]" value="" id="gd_share_1" class="form-control">
                        </div>  
                        </td>

                      </tr>
                      <tr>
                        <td style="text-align: center;" ><button type="button" class="gd_button btn btn-primary" data-id="2">+</button></td>
                      </tr>
                      <?php } ?>
                    </table>
                    </div>
                  </div>
                  <div class="form-group">
                  </div>
                  <script type="text/javascript">
                    $('.gd_button').on('click',function(){
                      var num = $(this).attr('data-id');
                      var html = '';
<<<<<<< HEAD
<<<<<<< HEAD
                      html += '<tr class="gd_id_card_'+num+'"><td>香港身份證：<div class="input-group"><input type="text" name="gd['+num+'][id_card]" value="" id="gd_id_card_'+num+'" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload_ic btn btn-primary" data-id="'+num+'" id="gd_id_card_upload_'+num+'" ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary gd_id_card_href_'+num+'" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr>';
=======
                      html += '<tr class="gd_id_card_'+num+'"><td>香港身份證：<div class="input-group"><input type="text" name="gd['+num+'][id_card]" value="" id="gd_id_card_'+num+'" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload_ic btn btn-primary" data-id="'+num+'" id="gd_id_card_upload_'+num+'" ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary gd_id_card_href_'+num+'" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr><tr class="gd_address_proof_1"><td>住址地址：<div class="input-group"><input type="text" name="gd[1][address_proof]" value="" id="gd_address_proof_1" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload_ap btn btn-primary" data-id='1' id='gd_address_proof_upload_1' ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary gd_address_proof_href_1" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr>';
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
=======
                      html += '<tr class="gd_id_card_'+num+'"><td>香港身份證：<div class="input-group"><input type="text" name="gd['+num+'][id_card]" value="" id="gd_id_card_'+num+'" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload_ic btn btn-primary" data-id="'+num+'" id="gd_id_card_upload_'+num+'" ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary gd_id_card_href_'+num+'" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr><tr class="gd_address_proof_1"><td>住址地址：<div class="input-group"><input type="text" name="gd[1][address_proof]" value="" id="gd_address_proof_1" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload_ap btn btn-primary" data-id='1' id='gd_address_proof_upload_1' ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary gd_address_proof_href_1" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr>';
>>>>>>> d186f0ac043b98de93b00ad49075690d01e0cbaa
                      html += '<tr class="gd_address_proof_'+num+'"><td>住址地址：<div class="input-group"><input type="text" name="gd['+num+'][address_proof]" value="" id="gd_address_proof_'+num+'" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload_ap btn btn-primary" data-id="'+num+'" id="gd_address_proof_upload_'+num+'" ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary gd_address_proof_href_'+num+'" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr>';
                      $(this).parent().parent().before(html);
                      num = ++num;
                      $(this).attr('data-id',num);
                    });
                  </script>
                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-contact_person_name" ><?php echo $entry_ds; ?></label>
                    <div class="col-sm-8">
                    <table class="table table-bordered">
                      <?php if($ds){ ?>
                        <?php foreach($ds as $value){ ?>
                      <tr class="ds_id_card_<?php echo $value['img_sort']; ?>">
                        <td>香港身份證： 
                        <div class="input-group">
                                <input type="text" name="ds[<?php echo $value['img_sort']; ?>][id_card]" value="<?php echo $value['img_path']; ?>" id="ds_id_card_<?php echo $value['img_sort']; ?>" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload2_ic btn btn-primary" data-id="<?php echo $value['img_sort']; ?>" id="ds_id_card_upload_<?php echo $value['img_sort']; ?>" style="<?php if($value['img_path']){ echo 'display: none'; } ?>" ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="<?php echo $domian.$value['img_path']; ?>" class="btn btn-primary ds_id_card_href_<?php echo $value['img_sort']; ?>" tyle="<?php if($value['img_path']){  }else{ echo 'display: none'; } ?>"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr class="ds_address_proof_<?php echo $value['img_sort']; ?>">
                        <td>住址地址：
                        <div class="input-group">
                                <input type="text" name="ds[<?php echo $value['img_sort']; ?>][address_proof]" value="<?php echo $value['img_addr_path']; ?>" id="ds_address_proof_<?php echo $value['img_sort']; ?>" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload2_ap btn btn-primary" data-id="<?php echo $value['img_sort']; ?>" id="ds_address_proof_upload_<?php echo $value['img_sort']; ?>" style="<?php if($value['img_addr_path']){ echo 'display: none'; } ?>" ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="<?php echo $domian.$value['img_addr_path']; ?>" class="btn btn-primary ds_address_proof_href_<?php echo $value['img_sort']; ?>" tyle="<?php if($value['img_addr_path']){  }else{ echo 'display: none'; } ?>"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                        <?php } ?>
                      <tr>
                        <td style="text-align: center;" ><button type="button" class="ds_button btn btn-primary" data-id="<?php $en = end($ds); echo $en['img_sort']+1; ?>">+</button></td>
                      </tr>
                      <?php }else{?>
                      <tr class="ds_id_card_1">
                        <td>香港身份證： 
                        <div class="input-group">
                                <input type="text" name="ds[1][id_card]" value="" id="ds_id_card_1" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload2_ic btn btn-primary" data-id='1' id='ds_id_card_upload_1' ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="" class="btn btn-primary ds_id_card_href_1" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr class="ds_address_proof_1">
                        <td>住址地址：
                        <div class="input-group">
                                <input type="text" name="ds[1][address_proof]" value="" id="ds_address_proof_1" class="form-control">
                                <span class="input-group-btn">
                                  <button type="button" class="button-upload2_ap btn btn-primary" data-id='1' id='ds_address_proof_upload_1' ><?php echo $button_upload; ?></button>
                                  <a target="_blank" href="" class="btn btn-primary ds_address_proof_href_1" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a>
                                  <button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button>
                                </span>
                        </div>  
                        </td>

                      </tr>
                      <tr>
                        <td style="text-align: center;" ><button type="button" class="ds_button btn btn-primary" data-id="2">+</button></td>
                      </tr>                      
                      <?php } ?>
                    </table>
                    </div>
                  </div>
                  <script type="text/javascript">
                    $('.ds_button').on('click',function(){
                      var num = $(this).attr('data-id');
                      var html = '';
                      html += '<tr class="ds_id_card_'+num+'"><td>香港身份證：<div class="input-group"><input type="text" name="ds['+num+'][id_card]" value="" id="ds_id_card_'+num+'" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload2_ic btn btn-primary" data-id="'+num+'" id="ds_id_card_upload_'+num+'" ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary ds_id_card_href_'+num+'" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr>';
                      html += '<tr class="ds_address_proof_'+num+'"><td>住址地址：<div class="input-group"><input type="text" name="ds['+num+'][address_proof]" value="" id="ds_address_proof_'+num+'" class="form-control"><span class="input-group-btn"><button type="button" class="button-upload2_ap btn btn-primary" data-id="'+num+'" id="ds_address_proof_upload_'+num+'" ><?php echo $button_upload; ?></button><a target="_blank" href="" class="btn btn-primary ds_address_proof_href_'+num+'" style="display: none;"><i class="fa fa-eye"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">查看</font></font></a><button type="button" data-type="" data-name="" data-id="" data-loading-text="" class="button-clear btn btn-danger"><i class="fa fa-eraser"></i><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> 清除</font></font></button></span></div></td></tr>';
                      $(this).parent().parent().before(html);
                      num = ++num;
                      $(this).attr('data-id',num);
                    });
                  </script>
                  
                  <div class="form-group">
                  </div>

                  <div class="form-group">
                    <label class="col-sm-2 control-label" for="input-remarks"><?php echo $entry_remarks; ?></label>
                    <div class="col-sm-8">
                      <textarea name="remarks" rows="5" placeholder="<?php echo $entry_remarks; ?>" class="form-control"><?php echo $remarks; ?></textarea>
                    </div>
                  </div>                  


                </div>
                <?php } ?>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
  <script type="text/javascript"><!--
<?php foreach ($languages as $language) { ?>
$('#input-description<?php echo $language['language_id']; ?>').summernote({
	height: 300
});
<?php } ?>
//--></script> 
<script type="text/javascript">

//股東
$('body').on('click', '.button-upload_ic',function() {
  var dn = $(this).attr('data-id');
  $('#form-upload').remove();
  var name = $(this).attr('id');
  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

  $('#form-upload input[name=\'file\']').trigger('click');

  if (typeof timer != 'undefined') {
      clearInterval(timer);
  }

  timer = setInterval(function() {
    if ($('#form-upload input[name=\'file\']').val() != '') {
      clearInterval(timer);

      // Reset everything
      $('.alert').remove();
      $('#progress-bar').css('width', '0%');
      $('#progress-bar').removeClass('progress-bar-danger progress-bar-success');
      $('#progress-text').html('');

      $.ajax({
        url: 'index.php?route=hk/company_setup/uploads&token=<?php echo $token; ?>',
        type: 'post',
        dataType: 'json',
        data: new FormData($('#form-upload')[0]),
        cache: false,
        contentType: false,
        processData: false,
        beforeSend: function() {
          $('button[data-type=\''+name+'_upload\']').button('loading');
        },
        complete: function() {
          $('.button-upload').button('reset');
        },
        success: function(json) {

          // $('input[name=\''+name+'_url\']').attr('value', json['project_file_id']);
          // $('button[data-clear=\''+name+'_clear\']').attr('data-name', json['project_file_id']);
          if (json['error']) {
            alert("文件上傳類型不符合");return false;
          }

          if(json['success']){
            alert('上傳成功');
            // console.log($(hf).length,json['fileurl']);
            $('#gd_id_card_'+dn).val(json['filename']);
            $('.gd_id_card_href_'+dn+'').attr('href',json['fileurl']).css('display','');
            $('#'+name).css('display','none');
          }
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
      });
    }
  }, 500);
});
$('body').on('click', '.button-upload_ap',function() {
  var dn = $(this).attr('data-id');
  $('#form-upload').remove();
  var name = $(this).attr('id');
  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

  $('#form-upload input[name=\'file\']').trigger('click');

  if (typeof timer != 'undefined') {
      clearInterval(timer);
  }

  timer = setInterval(function() {
    if ($('#form-upload input[name=\'file\']').val() != '') {
      clearInterval(timer);

      // Reset everything
      $('.alert').remove();
      $('#progress-bar').css('width', '0%');
      $('#progress-bar').removeClass('progress-bar-danger progress-bar-success');
      $('#progress-text').html('');

      $.ajax({
        url: 'index.php?route=hk/company_setup/uploads&token=<?php echo $token; ?>',
        type: 'post',
        dataType: 'json',
        data: new FormData($('#form-upload')[0]),
        cache: false,
        contentType: false,
        processData: false,
        beforeSend: function() {
          $('button[data-type=\''+name+'_upload\']').button('loading');
        },
        complete: function() {
          $('.button-upload').button('reset');
        },
        success: function(json) {

          // $('input[name=\''+name+'_url\']').attr('value', json['project_file_id']);
          // $('button[data-clear=\''+name+'_clear\']').attr('data-name', json['project_file_id']);
          if (json['error']) {
            alert("文件上傳類型不符合");return false;
          }

          if(json['success']){
            alert('上傳成功');
            // console.log($(hf).length,json['fileurl']);
            $('#gd_address_proof_'+dn).val(json['filename']);
            $('.gd_address_proof_href_'+dn+'').attr('href',json['fileurl']).css('display','');
            $('#'+name).css('display','none');
          }
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
      });
    }
  }, 500);
});






//董事
$('body').on('click', '.button-upload2_ic',function() {
  var dn = $(this).attr('data-id');
  $('#form-upload').remove();
  var name = $(this).attr('id');
  console.log(dn,name);
  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

  $('#form-upload input[name=\'file\']').trigger('click');

  if (typeof timer != 'undefined') {
      clearInterval(timer);
  }

  timer = setInterval(function() {
    if ($('#form-upload input[name=\'file\']').val() != '') {
      clearInterval(timer);

      // Reset everything
      $('.alert').remove();
      $('#progress-bar').css('width', '0%');
      $('#progress-bar').removeClass('progress-bar-danger progress-bar-success');
      $('#progress-text').html('');

      $.ajax({
        url: 'index.php?route=hk/company_setup/uploads&token=<?php echo $token; ?>',
        type: 'post',
        dataType: 'json',
        data: new FormData($('#form-upload')[0]),
        cache: false,
        contentType: false,
        processData: false,
        beforeSend: function() {
          $('button[data-type=\''+name+'_upload\']').button('loading');
        },
        complete: function() {
          $('.button-upload').button('reset');
        },
        success: function(json) {

          // $('input[name=\''+name+'_url\']').attr('value', json['project_file_id']);
          // $('button[data-clear=\''+name+'_clear\']').attr('data-name', json['project_file_id']);
          if (json['error']) {
            alert("文件上傳類型不符合");return false;
          }

          if(json['success']){
            alert('上傳成功');
            // console.log($(hf).length,json['fileurl']);
            $('#ds_id_card_'+dn).val(json['filename']);
            $('.ds_id_card_href_'+dn+'').attr('href',json['fileurl']).css('display','');
            $('#'+name).css('display','none');
          }
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
      });
    }
  }, 500);
});
$('body').on('click', '.button-upload2_ap',function() {
  var dn = $(this).attr('data-id');
  $('#form-upload').remove();
  var name = $(this).attr('id');
  $('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="file" /></form>');

  $('#form-upload input[name=\'file\']').trigger('click');

  if (typeof timer != 'undefined') {
      clearInterval(timer);
  }

  timer = setInterval(function() {
    if ($('#form-upload input[name=\'file\']').val() != '') {
      clearInterval(timer);

      // Reset everything
      $('.alert').remove();
      $('#progress-bar').css('width', '0%');
      $('#progress-bar').removeClass('progress-bar-danger progress-bar-success');
      $('#progress-text').html('');

      $.ajax({
        url: 'index.php?route=hk/company_setup/uploads&token=<?php echo $token; ?>',
        type: 'post',
        dataType: 'json',
        data: new FormData($('#form-upload')[0]),
        cache: false,
        contentType: false,
        processData: false,
        beforeSend: function() {
          $('button[data-type=\''+name+'_upload\']').button('loading');
        },
        complete: function() {
          $('.button-upload').button('reset');
        },
        success: function(json) {

          // $('input[name=\''+name+'_url\']').attr('value', json['project_file_id']);
          // $('button[data-clear=\''+name+'_clear\']').attr('data-name', json['project_file_id']);
          if (json['error']) {
            alert("文件上傳類型不符合");return false;
          }

          if(json['success']){
            alert('上傳成功');
            // console.log($(hf).length,json['fileurl']);
            $('#ds_address_proof_'+dn).val(json['filename']);
            $('.ds_address_proof_href_'+dn+'').attr('href',json['fileurl']).css('display','');
            $('#'+name).css('display','none');
          }
        },
        error: function(xhr, ajaxOptions, thrownError) {
          alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
      });
    }
  }, 500);
});






















$('body').on('click','.button-clear', function() {
  // console.log(111);
  var data_type = $(this).attr('data-type');
  // var da = {
  //     name:$(this).attr('data-name'),
  //     id:$(this).attr('data-id'),
  //     project_customer_id:$("input[name=\'project_customer_id\']").val(),
  // };
  var id = $(this).attr('data-id');
  var r=confirm("Are you sure?");
  if( r == true ){
  $.ajax({
    url: 'index.php?route=project/project_customer/clear&token=<?php echo $token; ?>',
    data:da,
    dataType: 'json',
    beforeSend: function() {
      $('#button-clear').button('loading');
    },
    complete: function() {
      $('#button-clear').button('reset');
    },
    success: function(json) {
      $('.alert').remove();

      if (json['error']) {
        $('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">&times;</button></div>');
      }

      if (json['success']) {
        $('input[name=\''+id+'_name\']').attr('value', '');
        $('input[name=\''+id+'_url\']').attr('value','');
          $('button[data-clear=\''+id+'_clear\']').attr('data-name', '');
          $('.'+data_type+'').remove();
          alert('Clear Success'); return false;
      }
    },
    error: function(xhr, ajaxOptions, thrownError) {
      alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    }
  });
}
});
</script>




  <script type="text/javascript"><!--
$('#language a:first').tab('show');
//--></script></div>
<?php echo $footer; ?>